<?php defined('IN_IA') or exit('Access Denied');?><!DOCTYPE html>
<html lang="en">
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <!-- Meta, title, CSS, favicons, etc. -->
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title><?php  echo $_W['current_module']['title'];?></title>
    <!-- Bootstrap -->
    <!--<link href="https://cdn.bootcss.com/bootstrap/3.3.6/css/bootstrap.css" rel="stylesheet">-->
    <!--<link href="https://cdn.staticfile.org/twitter-bootstrap/3.3.6/css/bootstrap.min.css" rel="stylesheet">-->
    <link href="../addons/<?php  echo $_GPC['m'];?>/them/bootstrap/bootstrap.min.css" rel="stylesheet">
    <!-- Font Awesome -->
    <!--<link href="https://cdn.bootcss.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">-->
    <!--<link href="https://cdn.staticfile.org/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet">-->
    <link href="../addons/<?php  echo $_GPC['m'];?>/them/font-awesome/font-awesome.min.css" rel="stylesheet">
    <!-- NProgress -->
    <!--<link href="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.css" rel="stylesheet">-->
    <!--<link href="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.css" rel="stylesheet">-->
    <link href="../addons/<?php  echo $_GPC['m'];?>/them/nprogress/nprogress.min.css" rel="stylesheet">

    <!--<link href="https://cdn.bootcss.com/switchery/0.8.2/switchery.min.css" rel="stylesheet">-->
    <!--<link href="https://cdn.staticfile.org/switchery/0.8.2/switchery.min.css" rel="stylesheet">-->
    <link href="../addons/<?php  echo $_GPC['m'];?>/them/switchery/switchery.min.css" rel="stylesheet">
    <!-- Custom Theme Style -->
    <link href="../addons/<?php  echo $_GPC['m'];?>/them/css/custom.min.css" rel="stylesheet">
    <!--<script src="https://cdn.bootcss.com/jquery/2.2.3/jquery.js"></script>-->
    <!--<script src="https://cdn.staticfile.org/jquery/2.2.3/jquery.min.js"></script>-->
    <script src="../addons/<?php  echo $_GPC['m'];?>/them/js/jquery.min.js"></script>
    <!--<script src="https://cdn.bootcss.com/bootstrap/3.3.6/js/bootstrap.min.js"></script>-->
    <!--<script src="https://cdn.staticfile.org/twitter-bootstrap/3.3.6/js/bootstrap.min.js"></script>-->
    <script src="../addons/<?php  echo $_GPC['m'];?>/them/bootstrap/bootstrap.min.js"></script>
    <!-- Bootstrap -->
    <!-- FastClick -->
    <!--<script src="https://cdn.bootcss.com/fastclick/1.0.6/fastclick.min.js"></script>-->
    <!--<script src="https://cdn.staticfile.org/fastclick/1.0.6/fastclick.min.js"></script>-->
    <script src="../addons/<?php  echo $_GPC['m'];?>/them/js/fastclick.min.js"></script>
    <!-- NProgress -->
    <!--<script src="https://cdn.bootcss.com/nprogress/0.2.0/nprogress.js"></script>-->
    <!--<script src="https://cdn.staticfile.org/nprogress/0.2.0/nprogress.min.js"></script>-->
    <script src="../addons/<?php  echo $_GPC['m'];?>/them/nprogress/nprogress.min.js"></script>
    <!--<script src="https://cdn.bootcss.com/switchery/0.8.2/switchery.min.js"></script>-->
    <!--<script src="https://cdn.staticfile.org/switchery/0.8.2/switchery.min.js"></script>-->
    <script src="../addons/<?php  echo $_GPC['m'];?>/them/switchery/switchery.min.js"></script>
    <!--<link href="https://cdn.bootcss.com/jquery-toast-plugin/1.3.2/jquery.toast.css" rel="stylesheet">-->
    <!--<link href="https://cdn.staticfile.org/jquery-toast-plugin/1.3.2/jquery.toast.min.css" rel="stylesheet">-->
    <link href="../addons/<?php  echo $_GPC['m'];?>/them/toast/toast.min.css" rel="stylesheet">
    <!--<script src="https://cdn.bootcss.com/jquery-toast-plugin/1.3.2/jquery.toast.min.js"></script>-->
    <!--<script src="https://cdn.staticfile.org/jquery-toast-plugin/1.3.2/jquery.toast.min.js"></script>-->
    <script src="../addons/<?php  echo $_GPC['m'];?>/them/toast/toast.min.js"></script>
    <style type="text/css">
        body .modal {top: 0;bottom:auto;}
        body::-webkit-scrollbar {width: 4px;height: 4px;}
        body::-webkit-scrollbar-thumb {border-radius: 5px;-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);background: rgba(0,0,0,0.2);}
        body::-webkit-scrollbar-track {-webkit-box-shadow: inset 0 0 5px rgba(0,0,0,0.2);border-radius: 0;background: rgba(0,0,0,0.1);}
        #iframecontents{height: calc(100vh - 82px);}
        #fullscreen {bottom: 10px;right: 10px;width: 35px;height: 35px;background-color: rgba(0,0,0,0.5);position: absolute;z-index: 9999;color: #fff;  border-radius: 50%;  font-weight: bold;  padding-top: 8px;  text-align: center;  cursor: pointer;  }
        .fullscreen .top_nav{display: none;}
        .fullscreen .bottom-nav{display: none;}
        .fullscreen #iframecontents{height: calc(100vh - 20px);}
        .w7-window-side{display: none;!important;}
    </style>
    <script type="text/javascript">
        $(function () {
            $("#fullscreen").click(function () {
                if( $(this).data("flag")=="1")
                {
                    $(this).data("flag","-1");
                    $("#containerbody").removeClass("fullscreen");
                    $("#fullscreen").html("全屏");
                }
                else{
                    $(this).data("flag","1");
                    $("#containerbody").addClass("fullscreen");
                    $("#fullscreen").html("返回");
                }

            })
        })
    </script>
</head>
<body class="nav-md">
<div class="pull-right related-info module-related-info" style="display: none">
</div>
<script>
    $.post('./index.php?c=module&a=display&do=accounts_dropdown_menu', {
        'module_name': "<?php  echo $_W['current_module']['name']?>",
        'version_id': "<?php  echo $_GPC['version_id']?>"
    }, function (data) {
        $('.module-related-info').html(data);
        $(".dropdown-usermenu").html($('.module-related-info').find(".dropdown-menu-right").html());
    }, 'html');
</script>
<div class="container body" id="containerbody">
    <div id="fullscreen">全屏</div>
    <div class="main_container">
        <?php (!empty($this) && $this instanceof WeModuleSite || 1) ? (include $this->template('common/menu', TEMPLATE_INCLUDEPATH)) : (include template('common/menu', TEMPLATE_INCLUDEPATH));?>
        <!-- top navigation -->
        <div class="top_nav">
            <div class="nav_menu">
                <nav>
                    <!--<div class="nav toggle">-->
                        <!--<a id="menu_toggle"><i class="fa fa-bars"></i></a>-->
                    <!--</div>-->
                    <ul class="nav navbar-nav navbar-right">
                        <li><a href="<?php  echo $this->createWebUrl('webconfig', array('op'=>'edit'));?>" class="roll-nav roll-right J_tabExit"><i class="fa fa fa-sign-out"></i> 返回旧版</a></li>
                        <li class="">
                            <a href="javascript:;" class="user-profile dropdown-toggle" data-toggle="dropdown"
                               aria-expanded="false">
                                <?php  if(file_exists(IA_ROOT. "/addons/". $_W['current_module']['name']. "/icon-custom.jpg")) { ?>
                                <img src="<?php  echo tomedia(" addons/".$_W['current_module']['name']."/icon-custom.jpg")?>"
                                class="head-app-logo" onerror="this.src='./resource/images/gw-wx.gif'">
                                <?php  } else { ?>
                                <img src="<?php  echo tomedia(" addons/".$_W['current_module']['name']."/icon.jpg")?>"
                                class="head-app-logo" onerror="this.src='./resource/images/gw-wx.gif'">
                                <?php  } ?> <?php  echo $_W['current_module']['title'];?>【<?php  echo $_W["account"]["name"];?>】
                                <!--<span class=" fa fa-angle-down"></span>-->
                            </a>
                            <ul class="dropdown-menu dropdown-usermenu pull-right">
                            </ul>
                        </li>
                    </ul>
                </nav>
            </div>
        </div>
        <!-- /top navigation -->
        <!-- page content -->
        <div class="right_col" role="main" style="padding-left: 0px; padding-right: 0px;">

            <iframe id="iframecontents" class="J_iframe" name="iframecontents" width="100%"
                    style=""
                    src="<?php  echo $this->createWebUrl('webconfig', array('op'=>'edit','new'=>1));?>"
                    frameborder="0"></iframe>
            <!--<iframe  id="iframecontents" class="J_iframe" name="iframecontents" width="99%"  style="height: calc(100vh - 80px)" src="https://wqstu.mweishop.com/web/index.php?c=site&a=entry&op=edit&do=webconfig&m=xc_xinguwu" frameborder="0" ></iframe>-->
            <?php  if(empty($_W['setting']['copyright']['footerleft'])) { ?>
            <div style="height: 20px;line-height: 20px;padding-left: 20px;" class="bottom-nav">
                Powered by <a href="http://www.we7.cc" style="display: inline-block;padding: 0px; margin: 0px"><b>系统</b></a> v<?php echo IMS_VERSION;?> &copy; 2014-2015 <a href="http://www.we7.cc" style="display: inline-block;padding: 0px; margin: 0px">www.we7.cc</a>
            </div>
            <?php  } else { ?>
            <div style="height: 20px;line-height: 20px;padding-left: 20px;" class="bottom-nav">
                <?php  echo $_W['setting']['copyright']['footerleft'];?>
            </div>
            <?php  } ?>
        </div>


        <!-- 模态框（Modal） -->
        <div class="modal fade" id="webhomeconfigmodel" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"
             aria-hidden="true">
            <div class="modal-dialog">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal" aria-hidden="true">
                            &times;
                        </button>
                        <h4 class="modal-title" id="myModalLabel">
                            辅助功能
                        </h4>
                    </div>
                    <div class="modal-body">
                        <div class="x_panel">
                            <h4>正常情况下请勿配制</h4>
                            <div class="x_content" id="ht_syscofni">
                                <div class="form-group">
                                    <label class="control-label col-md-2 col-sm-3 col-xs-12">强行https</label>
                                    <div class="col-md-10 col-sm-9 col-xs-12">
                                        <input type="checkbox" class="js-switch" value="1" name="ishttps"
                                               data-value="<?php  echo $ht_syscofnig['ishttps'];?>" data-field="ishttps">
                                    </div>
                                </div>
                            </div>
                            <div style="clear: both"></div>
                        </div>
                    </div>
                    <div class="modal-footer">
                        <button type="button" class="btn btn-default" data-dismiss="modal">关闭
                        </button>
                        <button type="button" class="btn btn-primary">
                            提交更改
                        </button>
                    </div>
                </div><!-- /.modal-content -->
            </div><!-- /.modal -->
        </div>

        <script type="text/javascript">
            $("#btnfz").click(function () {
                $('#webhomeconfigmodel').modal('show')
            })

            $("#ht_syscofni").find("[type='checkbox']").each(function () {
                if($(this).attr("data-value")=="1"){
                    $(this).attr("checked", "checked");
                }
            });



            var elem = document.querySelector('.js-switch');
            var init = new Switchery(elem);


            $("#ht_syscofni").find("[type='checkbox']").change(function () {

                if($(this).is(":checked")){
                    filevalue=1;
                }
                else
                {
                    filevalue=-1;
                }
                updateconfig(filevalue,$(this).attr("name"));
            })
            function  updateconfig(filevalue,filename) {

                $syspost={};
                $syspost["filename"]=filename
                $syspost["filevalue"]=filevalue
                $.ajax({
                    type: "post",
                    url: "<?php  echo $this->createWebUrl($do, array('op'=>'saveconfig'));?>",
                    dataType: "json",
                    data: $syspost,
                    success: function (msg) {
                        console.log(msg);
                        msg["heading"]=msg["message"];
                        msg["text"]=msg["message"];
                        xc_list_message(msg)
                    }
                });
            }


            function xc_list_message($obdata) {


                var _message={};

                _message["heading"]=$obdata["title"];
                _message["text"]=$obdata["text"];
                _message["icon"]=$obdata["type"];

                if($obdata["type"]=="error"){

                    _message["showHideTransition"]='fade';
                }
                $.toast(_message)
            }


            //    $('#webhomeconfigmodel').modal('hide')
        </script>


        <!-- 模态框（Modal） -->

        <script type="text/javascript">

            $("#pfrom").on("copy", ".payphone", function (e) {
                e.clipboardData.clearData();
                e.clipboardData.setData("text/plain", $(this).attr("data-phone"));
                //     e.clipboardData.setData("text/html", "<b>Direct binding - FOO</b>");
                e.preventDefault();
            });

        </script>
        <!-- /page content -->
        <!-- Custom Theme Scripts -->


        <script type="text/javascript">


            (function ($, sr) {



                // debouncing function from John Hann
                // http://unscriptable.com/index.php/2009/03/20/debouncing-javascript-methods/
                var debounce = function (func, threshold, execAsap) {
                    var timeout;

                    return function debounced() {
                        var obj = this, args = arguments;

                        function delayed() {
                            if (!execAsap)
                                func.apply(obj, args);
                            timeout = null;
                        }

                        if (timeout)
                            clearTimeout(timeout);
                        else if (execAsap)
                            func.apply(obj, args);

                        timeout = setTimeout(delayed, threshold || 100);
                    };
                };

                // smartresize
                jQuery.fn[sr] = function (fn) {
                    return fn ? this.bind('resize', debounce(fn)) : this.trigger(sr);
                };

            })(jQuery, 'smartresize');
            /**
             * To change this license header, choose License Headers in Project Properties.
             * To change this template file, choose Tools | Templates
             * and open the template in the editor.
             */


            $(".dropdown-toggle").click(function () {

                if ($(this).parent().hasClass("open")) {
                    $(this).parent().removeClass("open");
                }
                else {

                    $(this).parent().addClass("open")
                }
            })

            var CURRENT_URL = window.location.href.split('#')[0].split('?')[0],
                $BODY = $('body'),
                $MENU_TOGGLE = $('#menu_toggle'),
                $SIDEBAR_MENU = $('#sidebar-menu'),
                $SIDEBAR_FOOTER = $('.sidebar-footer'),
                $LEFT_COL = $('.left_col'),
                $RIGHT_COL = $('.right_col'),
                $NAV_MENU = $('.nav_menu'),
                $FOOTER = $('footer');


            // Sidebar
            function init_sidebar() {
// TODO: This is some kind of easy fix, maybe we can improve this
                var setContentHeight = function () {
                    $RIGHT_COL.css('min-height', $(window).height());

                };

//                $SIDEBAR_MENU.find('a').on('click', function (ev) {
//                    console.log('clicked - sidebar_menu');
//                    var $li = $(this).parent();
//
//                    if ($li.is('.active')) {
//                        $li.removeClass('active active-sm');
//                        $('ul:first', $li).slideUp(function () {
//                            setContentHeight();
//                        });
//                    } else {
//                        // prevent closing menu if we are on child menu
//                        if (!$li.parent().is('.child_menu')) {
//                            $SIDEBAR_MENU.find('li').removeClass('active active-sm');
//                            $SIDEBAR_MENU.find('li ul').slideUp();
//                        } else {
//                            if ($BODY.is(".nav-sm")) {
//                                $SIDEBAR_MENU.find("li").removeClass("active active-sm");
//                                $SIDEBAR_MENU.find("li ul").slideUp();
//                            }
//                        }
//                        $li.addClass('active');
//                        $li.siblings().removeClass('active');
//                        $('ul:first', $li).slideDown(function () {
//                            setContentHeight();
//                        });
//                    }
//                });

// toggle small or large menu
//                $MENU_TOGGLE.on('click', function () {
//                    console.log('clicked - menu toggle');
//
//                    if ($BODY.hasClass('nav-md')) {
//                        $SIDEBAR_MENU.find('li.active ul').hide();
//                        $SIDEBAR_MENU.find('li.active').addClass('active-sm').removeClass('active');
//                    } else {
//                        $SIDEBAR_MENU.find('li.active-sm ul').show();
//                        $SIDEBAR_MENU.find('li.active-sm').addClass('active').removeClass('active-sm');
//                    }
//
//                    $BODY.toggleClass('nav-md nav-sm');
//
//                    setContentHeight();
//
//                    $('.dataTable').each(function () {
//                        $(this).dataTable().fnDraw();
//                    });
//                });

                // recompute content when resizing
                $(window).smartresize(function () {
                    setContentHeight();
                });

                setContentHeight();

                // fixed sidebar
                if ($.fn.mCustomScrollbar) {
                    $('.menu_fixed').mCustomScrollbar({
                        autoHideScrollbar: true,
                        theme: 'minimal',
                        mouseWheel: {preventDefault: true}
                    });
                }
            };
            // /Sidebar

            var randNum = function () {
                return (Math.floor(Math.random() * (1 + 40 - 20))) + 20;
            };
            // Panel toolbox
            $(document).ready(function () {
                $('.collapse-link').on('click', function () {
                    var $BOX_PANEL = $(this).closest('.x_panel'),
                        $ICON = $(this).find('i'),
                        $BOX_CONTENT = $BOX_PANEL.find('.x_content');

                    // fix for some div with hardcoded fix class
                    if ($BOX_PANEL.attr('style')) {
                        $BOX_CONTENT.slideToggle(200, function () {
                            $BOX_PANEL.removeAttr('style');
                        });
                    } else {
                        $BOX_CONTENT.slideToggle(200);
                        $BOX_PANEL.css('height', 'auto');
                    }

                    $ICON.toggleClass('fa-chevron-up fa-chevron-down');
                });

                $('.close-link').click(function () {
                    var $BOX_PANEL = $(this).closest('.x_panel');

                    $BOX_PANEL.remove();
                });
            });
            // /Panel toolbox


            // Progressbar
            if ($(".progress .progress-bar")[0]) {
                $('.progress .progress-bar').progressbar();
            }

            // Accordion
            $(document).ready(function () {
                $(".expand").on("click", function () {
                    $(this).next().slideToggle(200);
                    $expand = $(this).find(">:first-child");

                    if ($expand.text() == "+") {
                        $expand.text("-");
                    } else {
                        $expand.text("+");
                    }
                });
            });

            // NProgress
            if (typeof NProgress != 'undefined') {
                $(document).ready(function () {
                    NProgress.start();
                });

                $(window).load(function () {
                    NProgress.done();
                });
            }

            $(document).ready(function () {
                init_sidebar();
            });
        </script>
        <!-- /footer content -->
        <script>
            function init(){
                $titleb = "", $url = "";
                $('[target="iframecontents"]').each(function () {
                    $xtitleb = $(this).parent().parent().prev().find(".xtitleb").text();
                    var $url = $(this).attr("href");
                    if ($url.indexOf("?")) {
                        $url = $url + "&";
                    }
                    else {

                        $url = $url + "?";
                    }
                    $url = $url+ "xtitleb=" + encodeURI($xtitleb) + "&xtitlea=" + encodeURI($(this).text())+'&new=1';
                    $(this).attr("href", $url);
                });
                var title=$(".left_col .nav li").eq(0).find(".xtitleb").text();
                var content=$(".left_col .nav li").eq(0).find("ul").html();
                $(".left_col2 .nav_title2 span").html(title);
                $(".left_col2 .menu_right").html(content);
                $(".left_col2 .menu_right").find("li").eq(0).addClass("curr");
            }
            init();
            $(function(){
                $(".left_col").on("click",'.left_col3 .nav li',function(){
                    if(!$(this).hasClass("active")){
                        $(this).siblings().removeClass("active");
                        $(this).addClass("active");
                        var title=$(this).find(".xtitleb").text();
                        var content=$(this).find("ul").html();
                        $(".left_col2 .nav_title2 span").html(title);
                        $(".left_col2 .menu_right").html(content);
                        $(".left_col2 .menu_right").find("li").eq(0).addClass("curr");
                    }
                });
                $(".left_col").on("click",'.left_col2 .nav li',function(){
                    $(this).siblings().removeClass("curr");
                    $(this).addClass("curr");
                });
                $(".left_nav").on('click','.nav',function(){
                    $(this).find().removeClass("curr");
                });
            })
        </script>
    </div>
</div>
</body>
</html>

</body>
</html>